"""DifyDjango URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from Dify.views import *

urlpatterns = [
    # 采购订单
    path('purchase/order/add', PurchaseView.as_view({'post': 'addOrder'})),
    # 采购单
    path('purchase/add', PurchaseView.as_view({'post': 'addPurchase'})),
    # 购货退货单
    path('purchase/exchange/add', PurchaseView.as_view({'post': 'addExchange'})),

    # 销售订单
    path('sales/order/add', SalesView.as_view({'post': 'addOrder'})),
    # 销售单
    path('sales/add', SalesView.as_view({'post': 'addSales'})),
    # 销售退货单
    path('sales/exchange/add', SalesView.as_view({'post': 'addExchange'})),

    # 获取管理员分组
    path('admin/group', AdminView.as_view({'post': 'login'})),
    path('admin/log/add', AdminView.as_view({'post': 'addLog'})),

    # BOM清单
    path('bom/add', BOMView.as_view({'post': 'addBom'})),
    path('bom/procedure/add', BOMView.as_view({'post': 'addProcedure'})),

    # 生产计划
    path('production/plan/add', ProductionView.as_view({'post': 'addPlan'})),
    path('production/mrp/add', ProductionView.as_view({'post': 'addMRP'})),

    # 生产单
    path('production/add', ProductionView.as_view({'post': 'addProduction'})),
    # 领料单
    path('production/picking/add', ProductionView.as_view({'post': 'addPicking'})),
    # 退料单
    path('production/material/add', ProductionView.as_view({'post': 'addMaterial'})),
    # 委外加工单
    path('production/outsourcing/add', ProductionView.as_view({'post': 'addOutSourcing'})),
    # 验收单
    path('production/acceptance/add', ProductionView.as_view({'post': 'addAcceptance'})),

    # 调拨单
    path('warehouse/allocation/add', WarehouseView.as_view({'post': 'addAllocation'})),
    # 盘点单
    path('warehouse/inventory/add', WarehouseView.as_view({'post': 'addInventory'})),
    # 其他入库单
    path('warehouse/warehouse/add', WarehouseView.as_view({'post': 'addWarehouse'})),
    # 其他出库单
    path('warehouse/outwarehouse/add', WarehouseView.as_view({'post': 'addOutWarehouse'})),
    # 组装单
    path('warehouse/assemble/add', WarehouseView.as_view({'post': 'addAssemble'})),
    # 拆卸单
    path('warehouse/split/add', WarehouseView.as_view({'post': 'addSplit'})),

    # 获取建表语句
    path('table/sql/get', TableSqlView.as_view({'post': 'getCreatTableSql'})),
    # 执行sql语句
    path('execute/sql', TableSqlView.as_view({'post': 'executeSql'})),

    # 获取excel表格
    path('excel/get', GetExcel.as_view({'post': 'getExcel'}))
]
